package com.bjut.vendormgrsys.model.domain;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

@Data
@Entity
@Table(name = "token")
@NoArgsConstructor
@RequiredArgsConstructor
public class TokenPO implements Serializable {
    /**
     * 主键IDE
     */
    @Id
    @GeneratedValue(generator = "token_id")
    @GenericGenerator(name = "token_id", strategy = "guid")
    @Column(name = "id", length = 36, unique = true, nullable = false)
    private String id;

    /**
     * 账号
     */
    @NonNull
    @Column(name = "account", unique = true, nullable = false)
    private String account;

    /**
     * token
     */
    @NonNull
    @Column(name = "token", columnDefinition = "TEXT CHARACTER SET utf8 COLLATE utf8_general_ci  NOT NULL")
    private String token;
}
